1. Field of the Invention
The present invention relates to a method of teaching a welding robot which is provided at its operating end with a spot welding gun.
2. Description of the Related Art
As a spot welding gun, there has hitherto been known one as disclosed in Japanese Published Unexamined Patent Application No. 328267/1994. Namely, on a gun main body there are provided a stationary electrode tip which is immovable relative to the gun main body, and a movable electrode tip which is operated for opening and closing by a pressing source (or a source for applying an electrode force) relative to the stationary electrode tip. The gun main body is arranged to be movable relative to a gun support bracket, by means of a driving source, in a direction in which both the electrode tips look toward each other (or lies opposite to each other).
This kind of spot welding gun is attached to an operating end of a welding robot by means of the gun support bracket. In performing the teaching of the welding robot, the following steps are taken. Namely, the spot welding gun is sequentially moved by manual operation to each of the weld spot positions of a workpiece. At each of the spot positions, the movable electrode tip is moved by the pressing source in a direction of closing the movable electrode tip. The stationary electrode tip is also moved by the movement of the driving source in a direction of closing it, whereby the workpiece is pinched between both the electrode tips. When this pinching point has coincided with an ordinary weld spot position of the workpiece, the positional data of each of the axes of the welding robot are stored as teaching data of that particular weld spot position.
The above-described spot welding gun can obtain an equalizing function by the movement of the gun main body by means of the driving source and, as long as the workpiece is inserted between both the electrode tips in a state in which the spot welding gun is opened, welding can be performed by pressing (or applying an electrode force to) the workpiece when the spot welding gun is closed. Therefore, in the conventional teaching, the position of the spot welding gun in the direction of pressing the workpiece is considered to be acceptable as long as the workpiece is inserted between both the electrode tips in a state in which the spot welding gun is open. The position thereof is thus not particularly monitored.
In the actual welding work, in order to shorten the time required for closing the spot welding gun, and also to prevent the workpiece from being deformed due to the striking by the electrode tips, it is desired to close each of the electrode tips at a relatively high speed until they approach the workpiece to a certain degree and, thereafter, close them at a low speed.
In the above-described conventional teaching method, however, at the time of operating the welding robot, the following may occur. Namely, even though the workpiece is inserted into the space between both the electrode tips which are in an open state, the workpiece may deviate toward one of the electrode tips. The electrode tips may therefore come into contact with the workpiece during the above-described high-speed movements of the electrode tips, resulting in a deformation of the workpiece.
In order to eliminate this kind of disadvantage, it becomes necessary to take measures such as to change the position for switching the speeds of movement of the electrode tips depending on the position of the workpiece or to amend the position, in the direction of pressing, of the spot welding gun relative to the workpiece.
In view of the above-described points, the present invention has an object of providing a method of teaching a welding robot in which a detection is made at the time of teaching as to in which position between both the electrode tips the workpiece is present, and the detected position is stored as the teaching data so that the above-described measures can be taken.